<template>
    <div id="app">
        <router-view />

    </div>
</template>


<script lang="ts">
import { h } from "vue";
import { Vue, Component } from "vue-property-decorator";

@Component({ name: "TPL" })
export default class index extends Vue {
    loading = false;
    showUpdateTips() {
        this.$notification["warning"]({
            message: "更新提示",
            description: "系统版本已更新，点击按钮刷新页面",
            btn: (h) =>
                h(
                    "a-button",
                    {
                        props: { type: "primary", size: "small" },
                        on: { click: () => location.reload() },
                    },
                    "更新"
                ),
        });
    }
    async getVersion() {
        console.log("v:" + process.env.version);
        // 获取最新的版本号 如果版本过低 提示刷新
        // const res = await getVersion({ skipCount: 0, maxResultCount: 1 })
        // if (res.items && res.items[0]) {
        //     console.info(process.env)
        //     const firstVersion = res.items[0].version
        //     const versionStr = firstVersion.split('-')[1]
        //     if (process.env && process.env.version) {
        //         document.getElementById('app').dataset.version = process.env.version
        //         if (versionStr && versionStr > process.env.version) {
        //             this.showUpdateTips()
        //         }
        //     }
        // }
    }

    async mounted() {
        this.getVersion();
    }
}
</script>
<style src="@wangeditor/editor/dist/css/style.css"></style>

<style lang="scss">
.editor {
    z-index: 999999;
    width: 100%;
    min-height: 500px;
    border: 1px solid #8d8d8d;
}
</style>
